package client.presen;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JRadioButton;

import javax.swing.WindowConstants;
import javax.swing.SwingUtilities;


/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class JFInicio extends javax.swing.JFrame {
	private JRadioButton jRadioButtonKenken;
	private ButtonGroup buttonGroup1;
	private JButton jButtonConectar;
	private JLabel jlbl;
	private JRadioButton jRadioButtonSudoku;
	private JFInicio inst;

	/**
	* Auto-generated main method to display this JFrame
	*/
	public static void main(String[] args) {
		SwingUtilities.invokeLater(new Runnable() {
			public void run() {
				JFInicio inst = new JFInicio();
				inst.setLocationRelativeTo(null);
				inst.setVisible(true);
			}
		});
	}
	
	public JFInicio() {
		super();
		initGUI();
	}
	
	private void initGUI() {
		try {
			setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
			
			getContentPane().setLayout(null);
			
			{
				jRadioButtonKenken = new JRadioButton();
				getContentPane().add(jRadioButtonKenken);
				jRadioButtonKenken.setText("Kenken");
				jRadioButtonKenken.setBounds(62, 84, 89, 31);
				jRadioButtonKenken.setFont(new java.awt.Font("Tahoma",1,12));
				getButtonGroup1().add(jRadioButtonKenken);
			}
			{
				jRadioButtonSudoku = new JRadioButton();
				getContentPane().add(jRadioButtonSudoku);
				jRadioButtonSudoku.setText("Sudoku");
				jRadioButtonSudoku.setBounds(224, 84, 103, 28);
				jRadioButtonSudoku.setFont(new java.awt.Font("Tahoma",1,12));
				getButtonGroup1().add(jRadioButtonSudoku);
			}
			{
				jButtonConectar = new JButton();
				getContentPane().add(jButtonConectar);
				getContentPane().add(getJlbl());
				jButtonConectar.setText("Conectar");
				jButtonConectar.setBounds(136, 163, 106, 32);
				jButtonConectar.setFont(new java.awt.Font("Tahoma",1,12));
				jButtonConectar.addActionListener(new ActionListener() {
					
					public void actionPerformed(ActionEvent evt) {
						System.out.println("jButtonConectar.actionPerformed, event="+evt);
						if (jRadioButtonKenken.isSelected()){
							JFKenken k = new JFKenken();
							k.setVisible(true);
							setVisible(false);
							
						}else if (jRadioButtonSudoku.isSelected()){
							JFSudoku j = new JFSudoku();
							j.setVisible(true);
							setVisible(false);
						
						}
					}
				});
			}
			pack();
			setSize(400, 300);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
	
	private ButtonGroup getButtonGroup1() {
		if(buttonGroup1 == null) {
			buttonGroup1 = new ButtonGroup();	
		}
		
		return buttonGroup1;
	}
	
	private JLabel getJlbl() {
		if(jlbl == null) {
			jlbl = new JLabel();
			jlbl.setText("Elija el juego al que desea jugar:");
			jlbl.setBounds(39, 30, 283, 33);
			jlbl.setFont(new java.awt.Font("Tahoma",1,14));
		}
		return jlbl;
	}

}
